<template>
<div>
  <table border="1" cellspacing="0" height="450" width="450">
    <tr>
      <td><img src="src/assets/logo.png">名字</td>
      <td>操作</td>
    </tr>
    <tr v-for="i in show_classify">
      <td>{{i.name}}</td>
      <td>
        <button @click="show_book(i.id)">查看</button>
      </td>
    </tr>
  </table>
  {{list}}
</div>
</template>

<script>
export default {
  name: "show_classify",
  data(){
    return{
      show_classify:[],
      list:[]
    }
  },
  methods:{
    classify(){
      this.$axios.get('/users/classifyM/')
      .then(res=>{
        this.show_classify=res.data.list
      })
    },
    show_book(id){
      this.$axios.get('/users/show_classifyM/?id='+id)
      .then(res=>{
        this.list=res.data.list
      })
    }
  },
  mounted() {
    this.classify()
  }
}
</script>

<style scoped>

</style>
